//
//  FMBaseUINavgationViewController.m
//  FMSManager
//
//  Created by hongbao.cui on 14-12-19.
//  Copyright (c) 2014年 hongbao.cui. All rights reserved.
//

#import "FMBaseUINavgationViewController.h"
#import "ApplicationUtils.h"
@interface FMBaseUINavgationViewController (){
}
@end

@implementation FMBaseUINavgationViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

}
//设置导航栏属性
-(void)setNavigationBarBg{
    NSString  *plistPath = [[NSBundle mainBundle] pathForResource:@"Config" ofType:@"plist"];
    NSMutableDictionary *dataDict = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
    NSString *default1 = [dataDict objectForKey:@"default"];
    if ([default1 isEqualToString:@"1"]) {
        return;
    }
    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                [UIColor whiteColor],
                                NSForegroundColorAttributeName, [UIFont boldSystemFontOfSize:20], NSFontAttributeName, nil];
    UIImage *topImage = [[ApplicationUtils getLocalImage:@"Navigation-Bar_backgroud_44@2x"] resizableImageWithCapInsets:UIEdgeInsetsMake(5.0, 5.0, 5.0, 5.0)];
    [[UINavigationBar appearance] setBackgroundImage:topImage forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setTitleTextAttributes:attributes];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
#pragma mark - 横竖屏切换
- (BOOL)shouldAutorotate
{
    //    return self.topViewController.shouldAutorotate;
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    //     return self.topViewController.supportedInterfaceOrientations;
    return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown;
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
@end
